/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package testonlineconnectdb;

import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;

/**
 *
 * @author AngelKid
 */
public class MainClass {
    public static void main(String[] args) throws ClassNotFoundException, SQLException, ParserConfigurationException, SAXException, IOException {        
//        TestOnlineConnectDB cDB = new TestOnlineConnectDB();
//        cDB.Connect("TestOnlineDatabase\\TestOnlineDB.accdb");
//        //With 3 is Test Type (1- Easy, 2 - NOrmal, 3 - Difficult). Get info about each type with GetType() function.
//        //5,5,10 is 5 easy, 5 normal, 10 difficult. Retrieve info with GetType function.
//        cDB.InitRandomTest("TestOnlineDatabase\\BankQuestion.xml", "TestOnlineDatabase\\TestOnlineDB.accdb",3,5,5,10);
        
        TestOnlineConnectDB cDB = new TestOnlineConnectDB();
        cDB.Connect("OnlineDatabase\\OnlineDB.accdb");
        ArrayList testTypes = cDB.GetType();          //Tr? v? lo?i
        if(testTypes == null)
        {
            System.out.println("table LoaiDeThi is empty");
            return;
        }
        for(int i =0; i < testTypes.size(); i++)
        {
            TestType temp = (TestType)testTypes.get(i);
            System.out.println(temp.name + "\t" +temp.time + "\t" +temp.numEasy + "\t" +temp.numNormal +"\t" + temp.numDifficult +"\n");
        }
    }
}
